<?php /* Smarty version 2.6.14, created on 2015-03-27 09:55:29
         compiled from game_manager.index.html */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('function', 'html_options', 'game_manager.index.html', 52, false),)), $this); ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "header.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<link href="<?php echo @BASEURI; ?>
public/css/jui/jui.css" type="text/css" rel="stylesheet" />
<script language="JavaScript" src="<?php echo @BASEURI; ?>
public/js/placeHolder.js"></script>
<script language="JavaScript" src="<?php echo @BASEURI; ?>
public/js/jquery-ui-1.8.23.custom.min.js" type="text/javascript"></script>
<script language="javascript" src="<?php echo @BASEURI; ?>
public/js/jquery.autocomplete.js"></script>
<link rel="stylesheet" type="text/css" href="<?php echo @BASEURI; ?>
public/css/jquery.autocomplete.css"/>
<form action="<?php echo $this->_tpl_vars['formAction']; ?>
" method="POST" <?php if ($this->_tpl_vars['is_validator']): ?> onsubmit="return Validator.Validate(this)" <?php endif; ?>>

<table border="0" class="search" cellspacing="0" id="search">
    <tr>
        <td>&nbsp;</td>
        <td>
            游戏名:
            <input type="text" name="country" id="selectGame" value="<?php echo $this->_tpl_vars['games'][$this->_tpl_vars['search']['game_id']]; ?>
" />
            <input type="text" name="s[game_id]" id="gamess" value="<?php echo $this->_tpl_vars['search']['game_id']; ?>
" style="display: none"/>|
            游戏key:
            <input class="text" style="width:240px" type="text" name="s[game_key]" id="game_key"  value="<?php echo $this->_tpl_vars['search']['game_key']; ?>
"/>
            <input type="submit" name="submit" value="<?php echo $this->_tpl_vars['systemLang']['submit']; ?>
" class="button" />
        </td>
    </tr>
</table>

<table width="100%" border="0" class="adminlist" cellspacing="0">

  <thead>
  <tr>
 	<!--<th><input id="toggle" type="checkbox" value=""/></th>-->
 	<!--<th><?php echo $this->_tpl_vars['systemLang']['platform']; ?>
</th>-->
	<th><?php echo $this->_tpl_vars['systemLang']['sort']; ?>
</th>
	<th><?php echo $this->_tpl_vars['systemLang']['gameIsDisplay']; ?>
</th>
	<th>&nbsp;</th>
    <th><?php echo $this->_tpl_vars['systemLang']['gameNumber']; ?>
</th>
    <th><?php echo $this->_tpl_vars['systemLang']['gameName']; ?>
</th>
    <th>soft_id</th>
    <th><?php echo $this->_tpl_vars['systemLang']['isforced']; ?>
</th>
    <th><?php echo $this->_tpl_vars['systemLang']['online_true']; ?>
</th>
	<th><?php echo $this->_tpl_vars['systemLang']['gameKey']; ?>
</th>
      <th>发送邮箱</th>
    <!--<th><?php echo $this->_tpl_vars['systemLang']['lang']; ?>
</th>
    <th><?php echo $this->_tpl_vars['systemLang']['gameCategory']; ?>
</th>
    <th><?php echo $this->_tpl_vars['systemLang']['gameScore']; ?>
</th> -->
    <th><?php echo $this->_tpl_vars['systemLang']['displayLocation']; ?>
</th>
    <th><?php echo $this->_tpl_vars['systemLang']['operate']; ?>
</th>
  </tr>
  </thead>
  <tbody>
  <?php $_from = $this->_tpl_vars['games']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['a'] => $this->_tpl_vars['game']):
?>
  <tr class="row0">
   <!--<td><input name="select_id[]" type="checkbox"  class="checkbox" id="cb<?php echo $this->_tpl_vars['a']; ?>
" value="<?php echo $this->_tpl_vars['game']['game_id']; ?>
" /></td>-->
   <!--<td><?php echo $this->_tpl_vars['platformList'][$this->_tpl_vars['game']['belong_platform']]; ?>
</td>-->
    <td> <select  id="game_order_<?php echo $this->_tpl_vars['game']['game_id']; ?>
">
	    <?php echo smarty_function_html_options(array('options' => $this->_tpl_vars['ordertotal'],'selected' => $this->_tpl_vars['game']['game_order']), $this);?>

    </select></td>
	<td><select  id="game_status_<?php echo $this->_tpl_vars['game']['game_id']; ?>
">
	    <?php echo smarty_function_html_options(array('options' => $this->_tpl_vars['game_status'],'selected' => $this->_tpl_vars['game']['game_status']), $this);?>

    </select></td>
	<td><input value="<?php echo $this->_tpl_vars['systemLang']['submit']; ?>
" type="button" class="button" onclick="abc('<?php echo @BASEURI; ?>
game_manager/submit/<?php echo $this->_tpl_vars['game']['game_id']; ?>
','game_order_<?php echo $this->_tpl_vars['game']['game_id']; ?>
','game_status_<?php echo $this->_tpl_vars['game']['game_id']; ?>
')"/></td>
    <td><?php echo $this->_tpl_vars['game']['game_id']; ?>
</td>
    <td><?php echo $this->_tpl_vars['game']['name']; ?>
</td>
    <td><?php echo $this->_tpl_vars['game']['soft_id']; ?>
</td>
    <td><?php if ($this->_tpl_vars['game']['isforced']): ?> <img src="/public/images/done.gif"> <?php else: ?> <img src="/public/images/delete.gif"> <?php endif; ?></td>
    <td><?php if ($this->_tpl_vars['game']['online_true']): ?> <img src="/public/images/done.gif"> <?php else: ?> <img src="/public/images/delete.gif"> <?php endif; ?></td>
	<td><?php echo $this->_tpl_vars['game']['game_key']; ?>
</td>
      <td><input id="email_<?php echo $this->_tpl_vars['game']['game_id']; ?>
" value=""> <input value="发送" type="button" onclick="pushMail('<?php echo @BASEURI; ?>
game_manager/pushMail/<?php echo $this->_tpl_vars['game']['game_id']; ?>
', 'email_<?php echo $this->_tpl_vars['game']['game_id']; ?>
')" class="button"></td>
    <!--<td><input value="<?php echo $this->_tpl_vars['systemLang']['submit']; ?>
" type="button" class="button" onclick="abc('<?php echo @BASEURI; ?>
game_manager/submit/<?php echo $this->_tpl_vars['game']['game_id']; ?>
','game_order_<?php echo $this->_tpl_vars['game']['game_id']; ?>
','game_status_<?php echo $this->_tpl_vars['game']['game_id']; ?>
')"/></td>
    <td><?php echo $this->_tpl_vars['country_type'][$this->_tpl_vars['game']['country_type']]; ?>
</td>
    <td><?php echo $this->_tpl_vars['game_type'][$this->_tpl_vars['game']['type']]; ?>
</td>
    <td><?php echo $this->_tpl_vars['game']['game_score']; ?>
</td> -->
    <td><?php echo $this->_tpl_vars['game_address'][$this->_tpl_vars['game']['game_address']]; ?>
</td>
	<td><!--<a href="http://www.gamewave.mobi/games/app/<?php echo $this->_tpl_vars['game']['game_id']; ?>
" target="_blank"><?php echo $this->_tpl_vars['systemLang']['preview']; ?>
</a>&nbsp;&nbsp;--><a href="<?php echo @BASEURI; ?>
game_manager/edit/<?php echo $this->_tpl_vars['game']['game_id']; ?>
"><?php echo $this->_tpl_vars['systemLang']['edit']; ?>
</a>&nbsp;
<a href="<?php echo @BASEURI; ?>
game_manager/delete/<?php echo $this->_tpl_vars['game']['game_id']; ?>
" onclick="return confirm('<?php echo $this->_tpl_vars['systemLang']['delConfirm']; ?>
')"><?php echo $this->_tpl_vars['systemLang']['del']; ?>
</a>&nbsp;&nbsp;<a href="<?php echo @BASEURI; ?>
recommend/recommendadd/<?php echo $this->_tpl_vars['game']['game_id']; ?>
"><?php echo $this->_tpl_vars['systemLang']['recommend']; ?>
</a>&nbsp;&nbsp;<a href="<?php echo @BASEURI; ?>
recommend/relevanceadd/<?php echo $this->_tpl_vars['game']['game_id']; ?>
"><?php echo $this->_tpl_vars['systemLang']['relatedRecommend']; ?>
</a>
&nbsp;&nbsp;<a href="javascript:void(0);" onclick="showLangTempla(<?php echo $this->_tpl_vars['game']['game_id']; ?>
)"><?php echo $this->_tpl_vars['systemLang']['inviteText']; ?>
</a>
</td>
  </tr>
  <?php endforeach; endif; unset($_from); ?>
  </tbody>
  <tfoot>
      <tr>
        <td>
            <input type="button"  class="button" value="<?php echo $this->_tpl_vars['systemLang']['del']; ?>
" onclick="select_control('<?php echo @BASEURI; ?>
game_manager/delete','<?php echo $this->_tpl_vars['systemLang']['delConfirm']; ?>
')"/>
            <input type="button"  class="button" value="<?php echo $this->_tpl_vars['systemLang']['add']; ?>
" onclick="button_location('<?php echo @BASEURI; ?>
game_manager/add')" accesskey="N" />
        </td>
       <td  colspan="6"><?php echo $this->_tpl_vars['page']; ?>
</td>
      </tr>
  </tfoot>

</table>
</form>


<div id="game_invite_template" title="<?php echo $this->_tpl_vars['systemLang']['gameInviteTextTpl']; ?>
" style=" width:400  px; height:400px; display:none;">
    <form action="gameinvitetemplate/save" method="post">
        <input type="hidden" id="lang_fgameid" name="id" />
        <table cellpadding="3" cellspacing="1" border="0" class="zz" style="width:100%;">
            <tr>
                <td width="130">qq<?php echo $this->_tpl_vars['systemLang']['cn']; ?>
</td>
                <td width="*" class="tal">
                    <input type="text" id="lang_qq" name="qq" />
                </td>
            </tr>
            <tr>
                <td width="130">qq<?php echo $this->_tpl_vars['systemLang']['en']; ?>
</td>
                <td width="*" class="tal">
                    <input type="text" id="lang_qq_en" name="qq_en" />
                </td>
            </tr>
            <tr>
                <td width="130">qq<?php echo $this->_tpl_vars['systemLang']['jp']; ?>
</td>
                <td width="*" class="tal">
                    <input type="text" id="lang_qq_jp" name="qq_jp" />
                </td>
            </tr>
            <tr>
                <td width="130">qq<?php echo $this->_tpl_vars['systemLang']['kr']; ?>
</td>
                <td width="*" class="tal">
                    <input type="text" id="lang_qq_ko" name="qq_ko" />
                </td>
            </tr>
            <tr>
                <td width="130">qq<?php echo $this->_tpl_vars['systemLang']['twCn']; ?>
</td>
                <td width="*" class="tal">
                    <input type="text" id="lang_qq_tw" name="qq_tw" />
                </td>
            </tr>
            <tr>
                <td width="130"><?php echo $this->_tpl_vars['systemLang']['weiboCn']; ?>
</td>
                <td width="*" class="tal">
                    <input type="text" id="lang_weibo" name="weibo" />
                </td>
            </tr>
            <tr>
                <td width="130"><?php echo $this->_tpl_vars['systemLang']['weiboEn']; ?>
</td>
                <td width="*" class="tal">
                    <input type="text" id="lang_weibo_en" name="weibo_en" />
                </td>
            </tr>
            <tr>
                <td width="130"><?php echo $this->_tpl_vars['systemLang']['weiboJp']; ?>
</td>
                <td width="*" class="tal">
                    <input type="text" id="lang_weibo_jp" name="weibo_jp" />
                </td>
            </tr>
            <tr>
                <td width="130"><?php echo $this->_tpl_vars['systemLang']['weiboKr']; ?>
</td>
                <td width="*" class="tal">
                    <input type="text" id="lang_weibo_ko" name="weibo_ko" />
                </td>
            </tr>
            <tr>
                <td width="130"><?php echo $this->_tpl_vars['systemLang']['weiboTwCn']; ?>
</td>
                <td width="*" class="tal">
                    <input type="text" id="lang_weibo_tw" name="weibo_tw" />
                </td>
            </tr>
            <tr>
                <td width="130">twitter<?php echo $this->_tpl_vars['systemLang']['cn']; ?>
</td>
                <td width="*" class="tal">
                    <input type="text" id="lang_twitter" name="twitter" />
                </td>
            </tr>
            <tr>
                <td width="130">twitter<?php echo $this->_tpl_vars['systemLang']['en']; ?>
</td>
                <td width="*" class="tal">
                    <input type="text" id="lang_twitter_en" name="twitter_en" />
                </td>
            </tr>
            <tr>
                <td width="130">twitter<?php echo $this->_tpl_vars['systemLang']['jp']; ?>
</td>
                <td width="*" class="tal">
                    <input type="text" id="lang_twitter_jp" name="twitter_jp" />
                </td>
            </tr>
            <tr>
                <td width="130">twitter<?php echo $this->_tpl_vars['systemLang']['kr']; ?>
</td>
                <td width="*" class="tal">
                    <input type="text" id="lang_twitter_ko" name="twitter_ko" />
                </td>
            </tr>
            <tr>
                <td width="130">twitter<?php echo $this->_tpl_vars['systemLang']['twCn']; ?>
</td>
                <td width="*" class="tal">
                    <input type="text" id="lang_twitter_tw" name="twitter_tw" />
                </td>
            </tr>
            <tr>
                <td width="130">facebook<?php echo $this->_tpl_vars['systemLang']['cn']; ?>
</td>
                <td width="*" class="tal">
                    <input type="text" id="lang_facebook" name="facebook" />
                </td>
            </tr>
            <tr>
                <td width="130">facebook<?php echo $this->_tpl_vars['systemLang']['en']; ?>
</td>
                <td width="*" class="tal">
                    <input type="text" id="lang_facebook_en" name="facebook_en" />
                </td>
            </tr>
            <tr>
                <td width="130">facebook<?php echo $this->_tpl_vars['systemLang']['jp']; ?>
</td>
                <td width="*" class="tal">
                    <input type="text" id="lang_facebook_jp" name="facebook_jp" />
                </td>
            </tr>
            <tr>
                <td width="130">facebook<?php echo $this->_tpl_vars['systemLang']['kr']; ?>
</td>
                <td width="*" class="tal">
                    <input type="text" id="lang_facebook_ko" name="facebook_ko" />
                </td>
            </tr>
            <tr>
                <td width="130">facebook<?php echo $this->_tpl_vars['systemLang']['twCn']; ?>
</td>
                <td width="*" class="tal">
                    <input type="text" id="lang_facebook_tw" name="facebook_tw" />
                </td>
            </tr>
        </table>
    </form>
</div>


<script>
function getSelectedValue(name){
var obj=document.getElementById(name);
return obj.value;      //直接用其对象的value属性便可获取到
}

function abc(url,a,b){
	ab=getSelectedValue(a);
	bc=getSelectedValue(b);
	window.location=url+'/'+ab+'/'+bc;
}

function pushMail(url, mail){
    mail = getSelectedValue(mail);
    if(checkform(mail)){
       console.log(url+'/'+mail);
       window.location=url+'/'+mail;
    }

}

function checkform(mail) {
    if(mail != '') {
        if(!Isyx(mail)){
            alert("请输入正确的邮箱地址!");
            return false;
        } else {
            return true;
        }
    } else {
        alert("请填写正确的邮箱地址!");
    }
}

function Isyx(yx){
    var reyx= /^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/;
    return(reyx.test(yx));
}


function showLangTempla(gid){
    $.post('/game_manager/gettpl',{"id" : gid},function(obj){
        for(var i in obj){
            $("#lang_" + i).val(obj[i]).attr("placeholder",'<?php echo $this->_tpl_vars['systemLang']['showJsTpl']; ?>
');
        }
    	placeHolder.init($('#game_invite_template input'));
        $("#game_invite_template").dialog('open');
    },'json');
    return false;
}

$(document).ready(function(){
   // $( "ui-dialog" ).dialog( "destroy" );
    $("#game_invite_template").dialog({
			autoOpen: false,
			height: 300,
			width: 500,
            maxHeight : 400,
            position: 'center',
            resizable: false,
            draggable : false,
            buttons : {
                "保存" : function(){
                    $.post('/game_manager/savetpl',$("#game_invite_template form").serialize(),function(r){
                       alert(r);
                    });
                    $( this ).dialog( "close" );
                },
                "取消" : function(){
                    $( this ).dialog( "close" );
                }
            }
    });
});


$("#selectGame").autocomplete("/game_manager/search",{
    max: 10,//显示数据条数
    minChars:1, //在触发autoComplete前用户至少需要输入的字符数 默认为0 在输入框内双击或者删除输入框内内容时显示列表
    matchCase:false,
    matchContains:true,
    //matchContains: "word",//只要包含输入字符就会显示提示
    autoFill:false,//自动填充输入框
    scroll:false,//不显示滚动条
    parse: function(data){
        var rows = [];
        var d = eval(data);
        for(var i=0; i<d.length; i++){
            rows[rows.length] = {
                data:d[i], //每条数据对象
                value:d[i].name, //与输入的值比较的数据
                result:d[i].name  //选中的实际数据
            };
        }
        return rows;
    },
    formatItem: function(row, i, max) {
        console.log(row);
        return   "<span class='ac_name'>"+row.name + "</span>";
    },
    formatMatch: function(row, i, max) {
        return row.name + " " + row.game_id;
    },
    formatResult: function(row) {
        return row.name;
    }
}).result(function(event, row, formatted) {
    $("#gamess").val(row.game_id);
});



</script>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "footer.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>